<?php
namespace app\api\model;

class AdminUser extends BaseModel
{
    /**
     *    登录效验
     * 1：登录成功
     * 2：账号错误
     * 3：密码错误
     */
    static public function Mlogin($data){
        $user_da = AdminUser::where('d_user','=',$data['username'])->find();
        if($user_da){
           if(AdminUser::where('d_pasw','=',md5($data['password']))->find()){
               return 1;
           }else{
               return 3;
           }
        }else{
            return 2;
        }
    }

}